Skip to content

⚠️ Drop unnecessary fields from machine status.nodeRef #12352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fabriziopandini
Copy link
Member

@fabriziopandini fabriziopandini commented Jun 13, 2025

What this PR does / why we need it:
Another cleanup to keep our API surface as small as clean as we can

Part of #6539

/area machine

@k8s-ci-robot k8s-ci-robot added area/machine Issues or PRs related to machine lifecycle management cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 13, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chrischdi for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from chrischdi and elmiko June 13, 2025 09:43
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 13, 2025
@sbueringer
Copy link
Member

/test pull-cluster-api-e2e-conformance-ci-latest-main
/test pull-cluster-api-e2e-conformance-main
/test pull-cluster-api-e2e-latestk8s-main
/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-mink8s-main
/test pull-cluster-api-e2e-upgrade-1-33-1-34-main

@@ -556,6 +556,15 @@ type MachineStatus struct {
Deprecated *MachineDeprecatedStatus `json:"deprecated,omitempty"`
}

// MachineNodeReference is a reference to a the node running on the machine.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// MachineNodeReference is a reference to a the node running on the machine.
// MachineNodeReference is a reference to the node running on the machine.

@@ -199,6 +200,8 @@ proposal because most of the changes described below are a consequence of the wo
- Support for terminal errors has been dropped.
- `status.failureReason` and `status.failureMessage` will continue to exist temporarily under `status.deprecated.v1beta1`.
- The const values for `Failed` phase has been deprecated in the enum type for `status.phase` (controllers are not setting this value anymore)
- The type of the `status.nodeRef` field has been changed from `corev1.ObjectReference` to `MachineNodeReference`.
- The following fields has been removed from `status.nodeRef`: `kind`, `namespace`, `uid`, `apiVersion`, `resourceVersion`, `fieldPath`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The following fields has been removed from `status.nodeRef`: `kind`, `namespace`, `uid`, `apiVersion`, `resourceVersion`, `fieldPath`
- The following fields have been removed from `status.nodeRef`: `kind`, `namespace`, `uid`, `apiVersion`, `resourceVersion`, `fieldPath`

Kind: "Node",
Namespace: "test-node",
},
NodeRef: &clusterv1.MachineNodeReference{},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add Name: "test-node". I think that was the intention of the old code

(same above in the other case)

@@ -68,7 +68,7 @@ controller_runtime_reconcile_panics_total{controller="clusterclass"} 0
# TYPE controller_runtime_webhook_panics_total counter
controller_runtime_webhook_panics_total 0
`),
wantErr: "panic occurred in \"cluster\" controller",
wantErr: "1 panics occurred in \"cluster\" controller (check logs for more details)",
Copy link
Member

@sbueringer sbueringer Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these tests not executed in CI?
(If yes, let's please fix that or open a help wanted issue for it. Doesn't have to be part of this PR of course)

They were not green before this change, right?

@sbueringer
Copy link
Member

/assign @JoelSpeed
PTAL :) (reviewing only the API change would be enough)

// +required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
Name string `json:"name"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Names are DNS1123 subdomain validated.

Lets borrow this comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/machine Issues or PRs related to machine lifecycle management cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants